package 美国疫情;

import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableComparator;

public class Group extends WritableComparator {
    @Override
    public int compare(WritableComparable a, WritableComparable b) {
        JavaBean bean1 = (JavaBean) a;
        JavaBean bean2 = (JavaBean) b;
        return (bean1.getDate().split("-")[1] + bean1.getStats()).compareTo(bean2.getDate().split("-")[1] + bean2.getStats());
    }

    protected Group() {
        super(JavaBean.class, true);
    }
}
